import request from '@/utils/request'

// 查询机台特性列表
export function listJtm(query) {
  return request({
    url: '/project/jtm/list',
    method: 'get',
    params: query
  })
}

// 查询机台特性详细
export function getJtm(jtmId) {
  return request({
    url: '/project/jtm/' + jtmId,
    method: 'get'
  })
}

// 新增机台特性
export function addJtm(data) {
  return request({
    url: '/project/jtm',
    method: 'post',
    data: data
  })
}

// 修改机台特性
export function updateJtm(data) {
  return request({
    url: '/project/jtm',
    method: 'put',
    data: data
  })
}

// 删除机台特性
export function delJtm(jtmId) {
  return request({
    url: '/project/jtm/' + jtmId,
    method: 'delete'
  })
}

// 导出机台特性
export function exportJtm(query) {
  return request({
    url: '/project/jtm/export',
    method: 'get',
    params: query
  })
}


export function changJtmFlag(jtmId,jtmFlag){
  const data = {
    jtmId,
    jtmFlag
  }
  return request({
    url: '/project/jtm',
    method: 'put',
    data: data
  })
}

//根据吨位查询对应机台
export function getJtmByTon(query){
  return request({
    url: '/project/jtm/selectJtmByTon',
    method: 'get',
    params: query
  })
}
//根据输入的值获得吨位
export function selectJtmByInput() {
  return request({
    url: '/project/jtm/selectJtmByInput',
    method: 'get'
  })
}
// 机台码字典
export function jtmDict(jtmFlag) {
  return request({
    url: '/project/jtm/jtmDict/'+jtmFlag,
    method: 'get'
  })
}
